﻿#region Using Statements
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Content.Pipeline.Graphics;
#endregion

namespace ContentBase.Sprites
{
    /// <summary>
    /// Stores build-time output data from a SpriteSheetProcessor, then serialized into XNB format and loaded at run-time into a SpriteSheet object.  
    /// </summary>
    [ContentSerializerRuntimeType("GameBase.Sprites.SpriteSheet, GameBase")]
    public class SpriteSheetContent
    {
        #region Fields

        [ContentSerializer]
        Texture2DContent texture = new Texture2DContent();

        [ContentSerializer]
        List<Rectangle> spriteRectList = new List<Rectangle>();

        [ContentSerializer]
        Dictionary<string, int> spriteNameList = new Dictionary<string, int>();

        #endregion

        #region Properties

        /// <summary>
        /// Gets or sets the single large texture used by this sprite sheet.
        /// </summary>
        public Texture2DContent Texture { get { return texture; } set { texture = value; } }

        /// <summary>
        /// Gets a list of rectangles indicating where in the texture each sprite has been placed.
        /// </summary>
        public List<Rectangle> SpriteRectangles { get { return spriteRectList; } }

        /// <summary>
        /// Gets for every sprite identified by its name its corresponding rectangle.
        /// </summary>
        public Dictionary<string, int> SpriteNames { get { return spriteNameList; } }

        #endregion
    }
}